package com.reflect;

import com.reflect.bean.Car;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {
        System.out.println("Hello World!");

        Map<String, String> m = new HashMap<>();
        m.put("a", "a1");
        m.put("b", "b1");
        m.put("c", "c1");

//        System.out.println(m.get("c"));
//
//        m.entrySet().stream().forEach(e -> {
//            System.out.println(e.getValue());
//        });
//
//        for (String s : m.keySet()) {
//            System.out.println(m.get(s));
//        }
//        System.out.println("**********************************************");
//        m.forEach((k, v) -> {
//            System.out.println(k);
//            System.out.println(v);
//        });
        System.out.println(m.toString());

        System.out.println("**********************************************");
        List<String> l = new ArrayList<>();
        l.add("ab");
        l.add("cd");
        System.out.println(l.toString());
        System.out.println("**********************************************");
        Map<String, Car> map = new HashMap<>();
        Car c1 = new Car();
        c1.setId(123);
        c1.setColor("blue");
        c1.setName("汉");
        map.put("a1",c1);

        Car c2 = new Car();
        c2.setId(124);
        c2.setColor("black");
        c2.setName("秦");
        map.put("c2",c2);

        List<Car> l1 = new ArrayList<>();

        map.forEach((k,v)->{
            l1.add(v);
        });
        System.out.println(l1.toString());
        for(Car c : l1){
            System.out.println(c);
        }
    }
}
